#include <memlayout.h>

		.section .__syscall_stub, "ax"

		.globl stub_exec_syscall
stub_exec_syscall:

		movl STUB_DATA, %eax
		cmp  $0, %eax
		jz	 read
		movl STUB_DATA + 4, %ebx
		movl STUB_DATA + 8, %ecx
		movl STUB_DATA + 12, %edx
		movl STUB_DATA + 16, %esi
		movl STUB_DATA + 20, %edi

		int $0x80

		jmp exit

read:
		# PTRACE_PEEKDATA doesn't work actually.
		movl STUB_DATA + 4, %ebx
		movl (%ebx), %eax

exit:	
		movl %eax, STUB_DATA

		int3